// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
require("es6-promise/auto");
import App from "./App";
import router from "./router";
import "lib-flexible";
import Vant from "vant";
import "vant/lib/index.css";
import "vant/lib/icon/local.css";
import axios from "axios";
import ddapi from "./auth/ddapi";
import RouteTransition from '@/components/vue-route-transition'
import Resource from "vue-resource";
import "./assets/icon/iconfont.css";
import store from "./store";
import bese from "./utils/bese";
import ewx from "./utils/ewx";
// import utils from "@/utils";
import "./permission";
import 'babel-polyfill'

Vue.use(bese);
Vue.use(ewx);
Vue.use(RouteTransition)
let bus = new Vue();
Vue.prototype.bus = bus;
Vue.prototype.$http = axios;
Vue.prototype.$ddapi = ddapi;

import VConsole from "vconsole";
const vConsole = new VConsole();

Vue.use(Resource);
Vue.use(Vant);
Vue.config.productionTip = false;

Vue.filter("text", function(value) {
  if (value.length > 7) {
    return value.slice(0, 7) + "....";
  } else {
    return value;
  }
});

new Vue({
  el: "#app",
  router,
  store,
  components: {
    App
  },
  template: "<App/>"
});
